<?php
namespace Mobile\Controller;
use Admin\Logic\CacheLogic;
use Think\Controller;

class IndexController extends Controller {

    //构造函数
    public function __construct()
    {
        parent::__construct();
        $allConfig = (new CacheLogic())->get_all_config();
        $this->assign('all_config', $allConfig);
        $this->assign('countCity', count($allConfig['customer_apply_city']));
        $this->assign('customer_apply_city', $allConfig['customer_apply_city']);
    }
    
    //贷款申请页
    public function index()
    {
        $this->display();
    }

    //贷款申请成功页面
    public function success()
    {
        $this->display();
    }

    /**
     * 获取文章内容
     * 包括隐私协议、服务协议、
     */
    public function article()
    {
        if (!empty(I('get.id'))) {
            $info = M('article')->where(array('id'=>I('get.id')))->find();
        } else {
            $info = M('article')->field('content')->where(array('name'=>'服务协议','status'=>1,'is_delete'=>0))->find();
        }
        $this->assign('content',$info['content']);
        $this->display();
    }
}